package com.qq.service.impl;

import com.qq.dao.OrderDao;
import com.qq.pojo.Order;
import com.qq.pojo.OrderCarCityUser;
import com.qq.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired(required = false)
    private OrderDao orderDao;


    @Override
    public int insertOrder(Order o) {
        return orderDao.insertOrder(o);
    }

    /**
     * 订单展示页面列表(四表联查)
     * @param id
     * @return
     */
    @Override
    public List<OrderCarCityUser> getOrderCarCityUserById(int id) {

        System.out.println(id);
        return orderDao.getOrderCarCityUserById(id);
    }

    /**
     * 根据订单id删除订单列表信息
     * @param id 订单id
     * @return
     */
    @Override
    public int deleteOrder(int id) {

        int i = orderDao.deleteOrderById(id);

        return i;
    }
}
